<h1>Listing books</h1>

<table>
  <tr>
    <th>Name</th>
    <th>Author</th>
    <th>Publisher</th>
    <th>Year</th>
    <th>Total</th>
    <th>Remain</th>
    <th>Total grade</th>
    <th>Total time</th>
    <th>Image url</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @books.each do |book| %>
  <tr>
    <td><%= book.name %></td>
    <td><%= book.author %></td>
    <td><%= book.publisher %></td>
    <td><%= book.year %></td>
    <td><%= book.total %></td>
    <td><%= book.remain %></td>
    <td><%= book.total_grade %></td>
    <td><%= book.total_time %></td>
    <td><%= book.image_url %></td>
    <td><%= link_to 'Show', book %></td>
    <td><%= link_to 'Edit', edit_book_path(book) %></td>
    <td><%= link_to 'Destroy', book, confirm: 'Are you sure?', method: :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Book', new_book_path %>
